package com.zhipu.balance.utils.data

import com.blankj.utilcode.util.TimeUtils
import com.zhipu.balance.mobile.dao.NumberDao
import com.zhipu.balance.mobile.dao.PersonnelDao
import com.zhipu.balance.mobile.event.Personnel
import com.zhipu.balance.mobile.event.Number

object DataGenerateUtils {
    /**
     * 数据生成
     */
    fun dataPersonnel(){
        var mPersonnelList = PersonnelDao.getInstance().allList
        if(null == mPersonnelList || mPersonnelList.size == 0){
            var mPersonnel = Personnel()
            /**
             * 名称
             */
            mPersonnel.name = "admin"
            /**
             * 创建时间
             */
            mPersonnel.creationTime = TimeUtils.getNowMills()
            /**
             * 添加
             */
            mPersonnel.save()
        }
    }

    /**
     * 数据生成
     */
    fun dataNumber(){
        var mNumberList = NumberDao.getInstance().allList
        if(null == mNumberList || mNumberList.size == 0){
            var mNumber = Number()
            /**
             * 名称
             */
            mNumber.name = "ZJTZSP"
            /**
             * 创建时间
             */
            mNumber.creationTime = TimeUtils.getNowMills()
            /**
             * 默认选中
             */
            mNumber.select = true
            /**
             * 添加
             */
            mNumber.save()
        }
    }
}